Page({
  data: {
    isLike: true,
    // banner
    indicatorDots: true, //是否显示面板指示点
    autoplay: true, //是否自动切换
    interval: 3000, //自动切换时间间隔,3s
    duration: 1000,//	滑动动画时长1s
    imgUrls: [
      'https://img12.360buyimg.com/n1/jfs/t1/100640/26/47525/91224/65f14f08F3f26a1dd/37e2817445d44a0e.jpg.avif',
      'https://img12.360buyimg.com/n1/jfs/t1/105530/22/45652/65514/65f02ffeF4e13284b/33d93bfa8cbcad70.jpg.avif',
      'https://img12.360buyimg.com/n1/jfs/t1/97685/28/44902/71235/65f0322bFdd38abb3/9fdf27ae707b0529.jpg.avif',
      'https://img12.360buyimg.com/n1/jfs/t1/224384/8/11256/72003/65f0323bF511838c2/5fca62955985d54d.jpg.avif',
      'https://img12.360buyimg.com/n1/jfs/t1/217614/15/37950/56627/65f03237Fb4087f79/d6d06ba67e31eeaa.jpg.avif'

    ],


    // 商品详情介绍
    detailImg: [
      "https://img30.360buyimg.com/sku/jfs/t1/245973/18/16106/54302/66bd7452F286fb6ef/4a49e3122a250675.jpg",
      "https://img30.360buyimg.com/sku/jfs/t1/232817/21/23770/137508/66bad4adFfbdc1e22/07a95123f768cee4.jpg",
      "https://img10.360buyimg.com/imgzone/jfs/t1/230590/36/22667/148777/66987005F27b2581d/c320e364649f6707.jpg",
    
      "https://img10.360buyimg.com/imgzone/jfs/t1/155604/30/44052/111499/664ae450Ff6470abd/d9e9aae657acb5da.jpg",
      "https://img10.360buyimg.com/imgzone/jfs/t1/154127/24/25549/84539/664ae44fF741ae142/d88fa0828033e2cc.jpg"
     
    ],
  },
  //预览图片
  onLoad() {
    console.log(this.data.imgUrls); // 检查数据是否正常
  },
  previewImage(e) {
    wx.previewImage({
      current: e.currentTarget.dataset.src,
      urls: this.data.imgUrls

    })
  },
  // 收藏
  addLike() {
    this.setData({
      isLike: !this.data.isLike
    });
  },
  // 跳到购物车
  toCar() {
    wx.switchTab({
      url: '/pages/cart/cart'
    })
  },
  // 立即购买
  immeBuy() {
    wx.showToast({
      title: '购买成功',
      icon: 'success',
      duration: 2000
    });
  },
})
